﻿Public Class TMyConnectInfo
    Private _UserName As String
    Private _Password As String
    Private _HostName As String
    Private _DatabaseName As String
    Private _PortNo As Integer = 3306

    Public Shadows ReadOnly Property ToString() As String
        Get
            Return _UserName & "," & _Password & "," & _HostName & "," & _DatabaseName & "," & _PortNo.ToString
        End Get
    End Property

    Public Property UserName() As String
        Get
            Return _UserName
        End Get
        Set(ByVal value As String)
            _UserName = value
        End Set
    End Property

    Public Property Password() As String
        Get
            Return _Password
        End Get
        Set(ByVal value As String)
            _Password = value
        End Set
    End Property

    Public Property HostName() As String
        Get
            Return _HostName
        End Get
        Set(ByVal value As String)
            _HostName = value
        End Set
    End Property

    Public Property DatabaseName() As String
        Get
            Return _DatabaseName
        End Get
        Set(ByVal value As String)
            _DatabaseName = value
        End Set
    End Property

    Public Property PortNo() As Integer
        Get
            Return _PortNo
        End Get
        Set(ByVal value As Integer)
            _PortNo = value
        End Set
    End Property

    Public ReadOnly Property ConnectionString() As String
        Get
            Return "Data Source=" & Me.HostName & ";database=" & Me.DatabaseName & ";User Id=" & Me.UserName & ";Password=" & Me.Password & ";Port=" & Me.PortNo.ToString
        End Get
    End Property
End Class
